package day15.test03;

// 圆类
class Circle {
    private double radius;

    public Circle(double radius) {
        this.radius = radius;
    }

    // 计算表面积
    public double getArea() {
        return Math.PI * radius * radius;
    }

    // 计算周长
    public double getPerimeter() {
        return 2 * Math.PI * radius;
    }

    @Override
    public String toString() {
        return "Circle [radius=" + radius + ", area=" + getArea() + ", perimeter=" + getPerimeter() + "]";
    }
}